package com.secfound.soccer.shared.db;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * Mock Class for testing
 * @author alfonso.ayala
 *
 */
public class BetDaoMock implements BetDao{

		Map<String, Bet> map = new LinkedHashMap<String, Bet>();
		
		{
			map.put("rhightower@mammatus.com", new Bet("Rick Hightower", 
	                                 "colombia","1", "holanda","2","2010-07-11 20:30", null));
			
		}
		
		public void add(Bet bet) {
			String email = bet.getChallenger();
			map.put(email, bet);
		}

		public List<Bet> list() {
			return Collections.unmodifiableList(new ArrayList<Bet>(map.values()));
		}

		public void remove(Bet bet) {
			map.remove(bet.getChallenger());
		}

		public void update(Bet bet) {		
			map.put(bet.getChallenger(), bet);
		}

	
}
